function convertImgToBasr64() {
  let img = document.getElementById("refreshCaptcha");
  var canvas = document.createElement("canvas");
  canvas.width = img.width;
  canvas.height = img.height;
  var ctx = canvas.getContext("2d");
  ctx.drawImage(img, 0, 0, img.width, img.height);
  var ext = img.src.substring(img.src.lastIndexOf(".") + 1).toLowerCase();
  var dataURL = canvas.toDataURL("image/" + ext);
//   console.log("dataURL", dataURL);
  const arr = dataURL.split(",");
  let baseStr = arr[arr.length - 1].trim();
//   console.log("baseStr", baseStr);
  return baseStr
}
